#!/bin/bash

isUpx=true

go clean
go env -w CGO_ENABLED=1
set GOOS=linux
set GOARCH=amd64

## without version
go build -trimpath -v -ldflags="-w -s" -o asl-ife-server .

if [ "$isUpx" = true ]; then
  echo "reduce capacity..."
  echo "./deployments/upx --lzma asl-ife-server"
  ./deployments/upx --lzma asl-ife-server
fi
